<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('成本结算')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    select {
        padding-top: 3px !important;
    }

    .select-list {
        margin-top: 5px !important;
    }
</style>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="settlement-form">
                <div class="col-sm-12">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>项目名称：</p>
                                <input type="text" name="proName" class="form-control">
                            </li>
                            <li>
                                <p>工程公司：</p>
                                <select name="compName" th:with="compName=${@dict.getType('company')}"
                                        class="form-control">
                                    <option value="">请选择</option>
                                    <option th:each="compName : ${compName}" th:text="${compName.dictLabel}"
                                            th:value="${compName.dictLabel}" th:title="${compName.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <p>流程状态：</p>
                                <select name="isFiled" class="form-control">
                                    <option value="">请选择</option>
                                    <option value="0">录入中</option>
                                    <option value="1">初审中</option>
                                    <option value="2">终审中</option>
                                    <option value="3">已归档</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportData('成本结算')">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: echarts-js"/>
<script th:inline="javascript">
    var prefix = ctx + "costSettlement";

    $(function () {
        var options = {
            uniqueId: "id",
            url: prefix + "/select",
            exportUrl: prefix + "/export",
            modalName: "成本结算",
            columns: [{
                checkbox: true
            },
                {
                    field: 'billNo',
                    title: '编号'
                },
                {
                    field: 'proName',
                    title: '项目名称'
                },
                {
                    field: 'compName',
                    title: '工程公司'
                },
                {
                    field: 'businessManager',
                    title: '商务经理'
                },
                {
                    field: 'auditContent',
                    title: '审核内容'
                },
                {
                    field: 'teamInfo',
                    title: '分包班组信息'
                },
                {
                    field: 'applyMoney',
                    title: '申请金额'
                },
                {
                    field: 'submitTime',
                    title: '提交日期'
                },
                {
                    field: 'approvalBy',
                    title: '审定人'
                },
                {
                    field: 'settlementMoney',
                    title: '结算审定金额'
                },
                {
                    field: 'reduceMoney',
                    title: '核减值'
                },
                {
                    field: 'reduceRate',
                    title: '核减率'
                },
                {
                    field: 'reduceReason',
                    title: '核减原因'
                },
                {
                    title: '状态',
                    field: 'isFiled',
                    formatter: function (value, row, index) {
                        if (row.isFiled == 3) {
                            return '<span class="label label-primary">已归档</span>';
                        }else if (row.isFiled == 2) {
                            return '<span class="label label-success">终审中</span>';
                        } else if (row.isFiled == 1) {
                            return '<span class="label label-info">初审中</span>';
                        } else {
                            return '<span class="label label-warning">录入中</span>';
                        }
                    }
                }]
        };
        $.table.init(options);
    });

</script>
</body>
</html>